package BaseClass;

public class Order {
    private String orderID;
    private String bookID;
    private String userID;
    private int number;
    private String address;
    private String phoneNumber;
    private String orderDate;
    private String status;

    public Order() {
    }

    public Order(String orderID) {
        this.orderID = orderID;
    }

    public Order(String orderID, String bookID, String userID, int number, String address, String phoneNumber, String orderDate, String status) {
        this.orderID = orderID;
        this.bookID = bookID;
        this.userID = userID;
        this.number = number;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.orderDate = orderDate;
        this.status = status;
    }

    public void setOrder(String orderID, String bookID, String userID, int number, String address, String phoneNumber, String orderDate, String status) {
        this.orderID = orderID;
        this.bookID = bookID;
        this.userID = userID;
        this.number = number;
        this.address = address;
        this.phoneNumber = phoneNumber;
        this.orderDate = orderDate;
        this.status = status;
    }


    public Object[] getOrderAttributeList() {
        Object[] list = new Object[8];
        list[0] = this.orderID;
        list[1] = this.bookID;
        list[2] = this.userID;
        list[3] = this.number;
        list[4] = this.address;
        list[5] = this.phoneNumber;
        list[6] = this.orderDate;
        list[7] = this.status;
        return list;
    }

    public boolean setOrderAttributeList(Object[] list) {
        if (list.length == 8) {
            this.setOrderID((String) list[0]);
            this.setBookID((String) list[1]);
            this.setUserID((String) list[2]);
            this.setNumber((int) list[3]);
            this.setAddress((String) list[4]);
            this.setPhoneNumber((String) list[5]);
            this.setOrderDate((String) list[6]);
            this.setStatus((String) list[7]);
            return true;
        } else {
            return false;
        }
    }

    public String getOrderID() {
        return orderID;
    }

    public void setOrderID(String orderID) {
        this.orderID = orderID;
    }

    public String getBookID() {
        return bookID;
    }

    public void setBookID(String bookID) {
        this.bookID = bookID;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(String orderDate) {
        this.orderDate = orderDate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderID='" + orderID + '\'' +
                ", bookID='" + bookID + '\'' +
                ", userID='" + userID + '\'' +
                ", number=" + number +
                ", address='" + address + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", orderDate='" + orderDate + '\'' +
                ", status='" + status + '\'' +
                '}';
    }
}
